package com.ler.nacosconfig.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lww
 * @date 2019-08-20 16:44
 */
@RestController
public class HeloController {

	@NacosValue(value = "${testkey}", autoRefreshed = true)
	private String testkey;

	//取值，如果没有使用默认值 123123
	@NacosValue(value = "${useLocalCache:123123}", autoRefreshed = true)
	private String useLocalCache;

	@GetMapping(value = "/get")
	public String get() {
		return useLocalCache + " | " + testkey;
	}

}
